<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="GraalVM demo">
    <meta name="author" content="Oracle Labs">
    <title>GraalVM ala Shiny demo</title>
    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="style.css" rel="stylesheet">
</head>
<body>
    <div class="row text-center">
        <h1><span style='color:red'>Oracle</span> Labs &nbsp; GraalVM <small>demo</small></h1>
    </div>
    <nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid" id="navfluid">
            <div class="row">
                <div class="collapse navbar-collapse navbar-inner">
                    <ul class="nav navbar-nav ">
                        <li class="active">
                            <a href="#" data-page="kmeans"><span class="glyphicon glyphicon-equalizer"></span> K-means clustering</a>
                        </li>
                        <li>
                            <a href="#" data-page="cars"><span class="glyphicon glyphicon-stats"></span> Cars dataset</a>
                        </li>
                        <li>
                            <a href="#" data-page="lm"><span class="glyphicon glyphicon-scale"></span> Linear model prediction</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </nav>

    <div class="container-fluid page" style="padding-top: 2em" id="kmeans">
        <div class="row">
            <div class="form-box col-sm-8 col-sm-offset-2 col-md-offset-1 col-md-2 col-lg-2">
                <form role="form" class="plot-form">
                  <div class="form-group">
                    <label for="xaxis">X-axis variable</label>
                    <select id="xaxis" class="input form-control">
                        <option value="Sepal.Length">Sepal.Length</option>
                        <option value="Sepal.Width">Sepal.Width</option>
                        <option value="Petal.Length">Petal.Length</option>
                        <option value="Petal.Width">Petal.Width</option>
                    <select>
                  </div>
                  <div class="form-group">
                    <label for="yaxis">Y-axis variable</label>
                    <select id="yaxis" class="input form-control">
                        <option value="Sepal.Length">Sepal.Length</option>
                        <option value="Sepal.Width" selected>Sepal.Width</option>
                        <option value="Petal.Length">Petal.Length</option>
                        <option value="Petal.Width">Petal.Width</option>
                    <select>
                  </div>
                  <div class="form-group">
                    <label for="clusters">Clusters</label>
                    <select id="clusters" class="input form-control">
                        <option value="3">3</option>
                        <option value="4" selected>4</option>
                        <option value="5">5</option>
                        <option value="6">6</option>
                    <select>
                  </div>
                </form>
            </div>
            <div>
                <p>Visualization of k-means clustering algorithm. Both the clusters computation 
                and the visualization are generated by FastR. This sample was inspired by similar demo used by Shiny web application framework for R. 
                In this case, the web part is implemented in Node.js</p>
                <div class="plot"></div>
            </div>
        </div>
    </div>

    <div class="container-fluid page" style="padding-top: 2em; display: none" id="cars">
        <div class="row">
            <div class="form-box col-sm-8 col-sm-offset-2 col-md-offset-1 col-md-2 col-lg-2">
                <form role="form" class="plot-form">
                  <div class="form-group">
                    <label for="xaxis">X-axis variable</label>
                    <select id="xaxis" class="input form-control">
                        <option value="mpg">Miles per galon</option>
                        <option value="cyl">Cylinders</option>
                        <option value="disp">Displacement</option>
                        <option value="hp">Horsepower</option>
                        <option value="drat">Rear axle ratio</option>
                        <option value="wt">Weight</option>
                        <option value="qsec">1/4 mile time</option>
                        <option value="gear"># of forward gears</option>
                    <select>
                  </div>
                  <div class="form-group">
                    <label for="yaxis">Y-axis variable</label>
                    <select id="yaxis" class="input form-control">
                        <option value="mpg">Miles per galon</option>
                        <option value="cyl" selected>Cylinders</option>
                        <option value="disp">Displacement</option>
                        <option value="hp">Horsepower</option>
                        <option value="drat">Rear axle ratio</option>
                        <option value="wt">Weight</option>
                        <option value="qsec">1/4 mile time</option>
                        <option value="gear"># of forward gears</option>
                    <select>
                  </div>
                  <div class="form-group">
                    <label for="zaxis">Z-axis variable</label>
                    <select id="zaxis" class="input form-control">
                        <option value="mpg">Miles per galon</option>
                        <option value="cyl">Cylinders</option>
                        <option value="disp" selected>Displacement</option>
                        <option value="hp">Horsepower</option>
                        <option value="drat">Rear axle ratio</option>
                        <option value="wt">Weight</option>
                        <option value="qsec">1/4 mile time</option>
                        <option value="gear"># of forward gears</option>
                   <select>
                  </div>
                </form>
            </div>
            <div>
                <p>This is an example plot with 3 axes. 
                The data used come from built-in <code>mtcars</code> dataset.</p>
                <div class="plot"></div>
            </div>
        </div>
    </div>

    <div class="container-fluid page" style="padding-top: 2em; display: none" id="lm">
        <div class="row">
            <div class="form-box col-sm-8 col-sm-offset-2 col-md-offset-1 col-md-2 col-lg-2">
                <h4>Linear Model Prediction</h4>
                <form role="form">
                  <div class="form-group">
                    <label for="height">Height (in)</label>
                    <input type="number" id="height" class="input form-control">
                  </div>
                  <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10"></div>
                    <button id="predict-button" type="submit" class="btn btn-default">Predict</button>
                  </div>
                </form>
                <hr/>
                <p id="prediction-text" style="display:none">Predicted weight is <em id="prediction"></em> lbs</p>
            </div>
            <div>
                <p>This is a classical example of linear regression computed and visualized by FastR 
                using <code>lm</code> built-in function and <code>lattice</code> package.
                The data used come from built-in <code>women</code> dataset 
                (the average heights and weights for American women aged 30–39).</p>
                <div class="plot"></div>
            </div>
        </div>
    </div>

    <script src="vendor/jquery.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.min.js"></script>
    <script src="script.js"></script>
</body>
</html>
